package com.example.guesswho

import android.content.Context
import com.parse.Parse
import com.parse.ParseObject
import com.parse.ParseLiveQueryClient
import okhttp3.OkHttpClient

object ParseClient {
    private const val BACK4APP_APP_ID = "NwrNwnQTDLxBoneM8ziHiyJCQ56miSCLEWYpPk4i"
    private const val BACK4APP_CLIENT_KEY = "KT0OObN8SpUJ4AklXs4QJwcoYsJPhkvMxvKSAXQe"
    private const val BACK4APP_SERVER_URL = "https://parseapi.back4app.com"
    
    private var isInitialized = false
    
    fun initialize(context: Context) {
        if (!isInitialized) {
            Parse.initialize(
                Parse.Configuration.Builder(context)
                    .applicationId(BACK4APP_APP_ID)
                    .clientKey(BACK4APP_CLIENT_KEY)
                    .server(BACK4APP_SERVER_URL)
                    .enableLocalDataStore()
                    .build()
            )
            
            isInitialized = true
        }
    }
    
    fun getAppId(): String = BACK4APP_APP_ID
    fun getClientKey(): String = BACK4APP_CLIENT_KEY
    fun getServerUrl(): String = BACK4APP_SERVER_URL
    fun isInitialized(): Boolean = isInitialized
}